package com.wv.model.basic;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("basic_building_structure")
public class BasicBuildingStructure {

    @TableId(value = "id", type = IdType.INPUT)
    private String id; // 主键

    private String structureName; // 结构名称

    private Integer structureLevel; // 结构层级,最多10级

    private String structureType; // 结构类型

    private String parentStructureId; // 父级结构

    private String structureFullIds; // 楼栋结构串,例如:-1-2-3-

    private String structureFullType; // 结构类型串,例如:-A-B-C-

    private String structureFullName; // 结构标识名称,例如:1期/1栋/1单元

    private String communityId; // 所属项目

    private String isDeleteFlag; // 是否删除:Y/N

    private String createUser; // 创建人

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime; // 创建时间

    @TableField(exist = false)
    private List<BasicBuildingStructure> children;

    public BasicBuildingStructure setChildren(List<BasicBuildingStructure> children) {
        this.children = children;
        return this;
    }
}
